Skip to content

DATAMONGO-1054 - Add support for fast insertion via MongoRepository.insert(..). #253

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from

Conversation

thomasdarimont
Copy link

Introduced new insert(..) method variants on MongoRepositories that delegates to MongoTemplate.insert(..). This bypasses ID-population, save event generation and version checking and allows for fast insertion of bulk data.

Thomas Darimont added 2 commits November 28, 2014 15:47
…nsert(..).

Introduced new insert(..) method variants on MongoRepositories that delegates to MongoTemplate.insert(..). This bypasses ID-population, save event generation and version checking and allows for fast insertion of bulk data.

Original pull request: #253.
…nsert(..).

Guesstimate the proper capacity for the result lists.
thomasdarimont pushed a commit that referenced this pull request Nov 28, 2014
…nsert(..).

Introduced new insert(..) method variants on MongoRepositories that delegates to MongoTemplate.insert(..). This bypasses ID-population, save event generation and version checking and allows for fast insertion of bulk data.

Original pull request: #253.
odrotbohm added a commit that referenced this pull request Nov 28, 2014
Tweaked JavaDoc of the APIs to be less specific about implementation internals and rather point to the save(…) methods. Changed SimpleMongoRepository.save(…) methods to inspect the given entity/entities and use the optimized insert(All)-calls if all entities are considered new.

Original pull request: #253.
thomasdarimont pushed a commit that referenced this pull request Nov 28, 2014
…nsert(..).

Introduced new insert(..) method variants on MongoRepositories that delegates to MongoTemplate.insert(..). This bypasses ID-population, save event generation and version checking and allows for fast insertion of bulk data.

Original pull request: #253.
odrotbohm added a commit that referenced this pull request Nov 28, 2014
Tweaked JavaDoc of the APIs to be less specific about implementation internals and rather point to the save(…) methods. Changed SimpleMongoRepository.save(…) methods to inspect the given entity/entities and use the optimized insert(All)-calls if all entities are considered new.

Original pull request: #253.
@odrotbohm odrotbohm closed this Nov 28, 2014
@odrotbohm odrotbohm deleted the issue/DATAMONGO-1054 branch November 28, 2014 17:38
@fdomig
Copy link

fdomig commented Apr 22, 2015

Prior this change, when extending SimpleMongoRepository<T, ID> it was possible to use protected getMongoOperations() to get hold of the specific mongoOperations. Why has that been removed and what is the suggested alternative for that?

Thanks.

@odrotbohm
Copy link
Member

Keep the MongoOperations interface handed into the constructor in a field.

@fdomig
Copy link

fdomig commented May 25, 2015

Thanks @olivergierke I just figured moments after adding this comment that this would be the obvious solution. My bad. Thanks though. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants